﻿namespace ModernChannel.Data
{
    using ModernChannel.Configuration;
    using ModernChannel.Data.DBConfig;
    using ModernChannel.Model.Model;
    using System.Linq;
    using System.Data.Entity;
    using ModernChannel.Model.Model.Base;

    public class ModernChannelEntities : DbContext
    {
        public ModernChannelEntities() : base(SystemConfiguration.ConnectionString) { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Configurations.Add(new ModernChannelConfiguration());
            modelBuilder.Configurations.Add(new ModelCatConfiguration());
            modelBuilder.Configurations.Add(new RegionConfiguration());
            modelBuilder.Configurations.Add(new ProvinceConfiguration());
            modelBuilder.Configurations.Add(new DistrictConfiguration());
            modelBuilder.Configurations.Add(new ShopInfConfiguration());
            modelBuilder.Configurations.Add(new BilltoInfConfiguration());
            modelBuilder.Configurations.Add(new OrderConfiguration());
            modelBuilder.Configurations.Add(new ShippingConfiguration());
            modelBuilder.Configurations.Add(new OrganizationConfiguration());
            modelBuilder.Configurations.Add(new ResponseSMSConfiguration());
            //modelBuilder.Configurations.Add(new SerialNumberCdcHistConfiguration());
            modelBuilder.Configurations.Add(new IncentiveAdhocConfiguration());
            modelBuilder.Configurations.Add(new AdhocDetailConfiguration());
            modelBuilder.Configurations.Add(new SerialNumberCdcHistConfiguration());
            modelBuilder.Configurations.Add(new SerialNumberRdcHistConfiguration());
        }

        public DbSet<ModernChannels> ModernChannels { get; set; }
        public DbSet<District> Districts { get; set; }
        public DbSet<Province> Provinces { get; set; }
        public DbSet<Region> Regions { get; set; }
        public DbSet<ShopInf> ShopInf { get; set; }
        public DbSet<ModelCat> ModelCat { get; set; }
        public DbSet<BilltoInf> BilltoInf { get; set; }
        public DbSet<OrderInfo> Orders { get; set; }
        public DbSet<ShippingInfo> ShippingInfos { get; set; }
        public DbSet<Organization> Organizations { get; set; }
        public DbSet<ResponseSMS> ResponseSMSs { get; set; }
        //public DbSet<SerialNumberCdcHist> SerialNumberCdcHist { get; set; }

        public DbSet<AdhocDetail> AdhocDetails { get; set; }
        public DbSet<IncentiveAdhoc> IncentiveAdhoc { get; set; }
        public DbSet<SerialNumberRdcHist> SerialNumberRdcHistory { get; set; }
        public DbSet<SerialNumberCdcHist> SerialNumberCdcHistory { get; set; }

    }
}
